/**
 * @Author: lll
 * @Email:li.lele@vpclub.cn
 * @Date: create in 2020/6/28
 */
package cn.vpclub.admin.util;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class BaseResponse {
    private Integer code;
    private String message;
    private Object data;

    public BaseResponse() {
    }

    public BaseResponse(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public BaseResponse(ResponseCodeEnum responseCodeEnum, Object data) {
        this.code = responseCodeEnum.getCode();
        this.message = responseCodeEnum.getMessage();
        this.data = data;
    }

    public static BaseResponse info(ResponseCodeEnum responseCodeEnum, Object data) {
        return new BaseResponse(responseCodeEnum, data);
    }

    public static BaseResponse customInfo(Integer code, String message, Object data) {
        return new BaseResponse(code, message, data);
    }
}
